#重写继承方法和属性
#INFO:⼦类和⽗类具有同名属性和⽅法，默认使⽤⼦类的同名属性和⽅法。
class Master(object):
  def __init__(self):
    self.kongfu="[古法煎饼果子配方]"
  def makeCake(self):
    print(f"运用{self.kongfu}制作煎饼果子")
    
class School(object):
  def __init__(self):
    self.kongfu="[垃圾煎饼果子配方]"
  def makeCake(self):
    print(f"运用{self.kongfu}制作煎饼果子")
class Prentice(School,Master):
  def __init__(self):
    self.kongfu="[自创煎饼果子配方]"
  #定义私有属性
    self.__money=2000
  #获取私有属性
  def getMoney(self):
    return self.__money
  #修改私有属性
  def setMoney(self):
    self.__money=500
  #定义私有方法
  def __infoPrint(self):
    print(self.__money)
    print(self.kongfu)
  def makeCake(self):
    print(f"运用{self.kongfu}制作煎饼果子")
  def makeMasterCake(self):
    Master.__init__(self)
    Master.makeCake(self)
  def makeSchoolCake(self):
    School.__init__(self)
    School.makeCake(self)
class tusun (Prentice):
  pass

tudi=Prentice()
# tudi.__infoPrint()
daqiu=tusun()
print(daqiu.kongfu)
daqiu.makeCake()
daqiu.makeMasterCake()
daqiu.makeSchoolCake()
daqiu.setMoney()
print(daqiu.getMoney())